<html xsl:version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns="http://www.w3.org/TR/xhtml1/strict"
>
	<head>
		<title>
			<![CDATA[Test]]>
		</title>
	</head>
	<body>
		<!-- 
		LIST OF QUESTIONS
		 -->
		<a name="top"/>
		<xsl:for-each select="Mock-test/Question">
			<a>
				<xsl:attribute name="href">
					<![CDATA[#]]>
					<xsl:value-of select="@id"/>
				</xsl:attribute>
				<xsl:value-of select="@id"/>
			</a>
			<![CDATA[ / ]]>			
		</xsl:for-each>
		<hr/>
		<table border="0" width="100%">		
			<xsl:for-each select="Mock-test/Question">
				<tr>
					<th style="text-align: left">
						<!-- 
						ANCHOR TO THIS QUESTION
						 -->
						<a>
							<xsl:attribute name="name">
								<xsl:value-of select="@id"/>
							</xsl:attribute>
							(<xsl:value-of select="@id"/> - <xsl:value-of select="@objective"/>)
						</a>						
						<pre><xsl:value-of select="Question-description"/></pre>
						<xsl:choose>
							<xsl:when test="@picture-URL!=''">
								<a target="_blank">
									<xsl:attribute name="href">
										<!--  http://nicky.cust.ipeer.se/moelholmweb/pages/mocks/ -->
										<![CDATA[../]]>
										<xsl:value-of select="@picture-URL"/>
									</xsl:attribute>
									<![CDATA[IMAGE]]>
								</a>
							</xsl:when>
						</xsl:choose>
					</th>
					<th align="right" valign="top">
						<a href="#top">
							<![CDATA[Top]]>
						</a>
					</th>
				</tr>
				<!-- 
				OPTIONS
				 -->
				<xsl:for-each select="Option">
					<xsl:variable name="txtID">
						<![CDATA[txt]]>
						<xsl:value-of select="../@id"/>
						<![CDATA[_]]>
						<xsl:value-of select="position()"/>
					</xsl:variable>
					<tr>
						<td colspan="2">
							<a onMouseOver="this.style.textDecoration='underline'"
							   onMouseOut="this.style.textDecoration=''"
							>
								<xsl:attribute name="title">
									<xsl:value-of select="@value"/>
									<xsl:choose>
										<xsl:when test="Reason!=''">										
											<![CDATA[ - ]]>
											<xsl:value-of select="Reason"/>
										</xsl:when>
									</xsl:choose>
								</xsl:attribute>
								<xsl:attribute name="onClick">
									<![CDATA[javascript:alert(']]>
									<xsl:value-of select="@value"/>
									<![CDATA[']]>
									<xsl:choose>
										<xsl:when test="Reason!=''"> 
											<![CDATA[+ ' - ' + document.getElementById(']]>
											<xsl:value-of select="$txtID"/>
											<![CDATA[').value]]>
										</xsl:when>
									</xsl:choose>
									<![CDATA[);]]>
								</xsl:attribute>
								<pre><xsl:value-of select="Option-description"/><xsl:value-of select="Opt-desc"/></pre>
								<xsl:choose>
									<xsl:when test="Reason!=''"> 
										<textarea style="display:none" rows="0" cols="0">
											<xsl:attribute name="id">
												<xsl:value-of select="$txtID"/>
											</xsl:attribute>
											<xsl:value-of select="Reason"/>
										</textarea>
									</xsl:when>
								</xsl:choose>
							</a>
						</td>
					</tr>
				</xsl:for-each>
				<!-- 
				SHOW ANSWERS BUTTON
				 -->
				<tr>
					<th colspan="3" align="center">
						<input type="button" value="Show Answers">
							<xsl:attribute name="onClick">
								<![CDATA[javascript:alert(']]>
								<xsl:for-each select="Option[@value='True']">
									<xsl:value-of select="substring(Option-description,1,1)"/>
								</xsl:for-each>
								<![CDATA[');]]>
							</xsl:attribute>
						</input>
					</th>
				</tr>
				<tr>
					<th colspan="3" backgroud="#c0c0c0">						
						<hr/>
					</th>
				</tr>
			</xsl:for-each>
		</table>
	</body>
</html>